package com.itheima.Demo;

public class Student {
    private String name ;
    private int age ;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
    public void eat(String food){
        System.out.println("学生吃" + food);
    }

    //睡觉
    public void sleep(){
        System.out.println("学生不需要睡觉 写代码就可以了");
    }

    //私有 玩的方法
    private void play(String s){
        System.out.println("学习喜欢玩" + s);
    }
}
